package A;

/**
 * @Author czl
 * @Date 2024-03-19
 */
public class SumThread extends Thread{
    private int m;
    private int n;
    private long sum;

    public SumThread(int m, int n) {
        this.m = m;
        this.n = n;
    }

    @Override
    public void run() {
        sum = 0;
        for (int i = m; i <= n; i++) {
            sum += i;
        }
    }

    public long getSum() {
        return sum;
    }
}
